package xcu.lxj.nettychat.chat.service.inter;

import xcu.lxj.nettychat.chat.domain.dto.MsgReadInfoDTO;
import xcu.lxj.nettychat.chat.domain.entity.Message;
import xcu.lxj.nettychat.chat.domain.vo.request.*;
import xcu.lxj.nettychat.chat.domain.vo.request.member.MemberReq;
import xcu.lxj.nettychat.chat.domain.vo.response.ChatMemberResp;
import xcu.lxj.nettychat.chat.domain.vo.response.ChatMessageReadResp;
import xcu.lxj.nettychat.chat.domain.vo.response.ChatMsgResp;
import xcu.lxj.nettychat.common.domain.vo.response.CursorPageBaseResp;

import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;

/**
 * @Author XinJian Lei
 * @Date 2024/9/28 17:25
 * @Version 1.0
 */
public interface ChatService {


    /**
     * 发送消息
     *
     */
    Long sendMsg(ChatMsgReq request, Long uid);

    /**
     *  获取单个 信息返回值
     */
    public ChatMsgResp getMsgResp(Message message, Long receiveUid);

    /**
     *  根据消息id 和发送人 构建消息
     *
     */
    public ChatMsgResp getMsgResp(Long msgId, Long receiveUid);

    /**
     * 获取消息列表
     *
     */
    CursorPageBaseResp<ChatMsgResp> getMsgPage(ChatMessagePageReq request, @Nullable Long receiveUid);

    /**
     * 消息撤回
     *
     */
    void recallMsg(Long uid, ChatMessageBaseReq request);

//    /**
//     * 获取群成员列表
//     *
//     * @param memberUidList
//     * @param request
//     * @return
//     */
    CursorPageBaseResp<ChatMemberResp> getMemberPage(List<Long> memberUidList, MemberReq request);

//    ChatMemberStatisticResp getMemberStatistic();

//    void setMsgMark(Long uid, ChatMessageMarkReq request);

//    List<ChatMemberListResp> getMemberList(ChatMessageMemberReq chatMessageMemberReq);

    /**
     * 查询自己消息 已读 和 未读 的数量
     */
    Collection<MsgReadInfoDTO> getMsgReadInfo(Long uid, ChatMessageReadInfoReq request);

    /**
     * 查看自己消息已读或者未读的uid
     */
    CursorPageBaseResp<ChatMessageReadResp> getReadPage(Long uid, ChatMessageReadReq request);

    /**
     * 更新 阅读时间
     */
    void msgRead(Long uid, ChatMessageMemberReq request);
}
